let app = getApp()
const prefixGoods = app.globalData.dev == 'DEV' ? app.globalData.newApi + '8072/goods/' : app.globalData.newApi
const prefixOrder = app.globalData.dev == 'DEV' ? app.globalData.newApi + '8072/order/' : app.globalData.newApi
const prefixMember = app.globalData.dev == 'DEV' ? app.globalData.newApi + '8072/member/' : app.globalData.newApi
const prefixMarking = app.globalData.dev == 'DEV' ? app.globalData.newApi + '8072/marking/' : app.globalData.newApi
const prefixAck = app.globalData.dev == 'DEV' ? 'http://192.168.2.121:8996/' : app.globalData.newApi
const prefixLimit=app.globalData.newApi

let goods = {
  /**
   * 查询分类
   */
  goodsListByCate() {
    return prefixGoods + 'applet/goodsListByCate'
  },
  goodsClass() {
    return prefixGoods + 'applet/selShopGoodsCategoryOne'
  },
  goodsClasstwo() {
    return prefixGoods + 'applet/selShopGoodsCategoryTwo'
  },
  goodsClasstotal() {
    return prefixGoods + 'applet/selCategoryTotal'
  },
  goodsDetail() {
    return prefixGoods + 'applet/goodsDetail'
    // return prefixGoods + 'api/goods/detail'
  },
  getGoodsSku() {
    return prefixGoods + 'applet/getGoodsSku'
  },
  getDiy() {
    return prefixGoods + 'sms/diyDetail'
  },
  getGoodDiy() {
    return prefixGoods + 'applet/selDiyPageGoodsDetail'
  },
  getUser() {
    return prefixGoods + 'applet/selUser'
  },
  getDiypageDetail() {
    return prefixGoods + 'shop/diypage/detail'
  },

  // 启动广告
  getAd() {
    return prefixGoods + 'applet/selStartAdvert'
  },
  // 定制服务
  getselectCust() {
    return prefixGoods + 'applet/selectCust'
  },
  //搜索
  searchGoods() {
    return prefixGoods + 'applet/searchGoods'
  },
  //付邮商品
  selMail() {
    return prefixGoods + 'applet/selMail'
  },
}

let orders = {
  /**
   * 获取购物车
   */
  getCart() {
    return prefixOrder + 'applet/cartList'
  },
  cartGoodsCount() {
    return prefixOrder + 'applet/cartGoodsCount'
  },
  getDelete() {
    return prefixOrder + 'applet/delete'
  },
  getisCheckCart() {
    return prefixOrder + 'applet/isCheckCart'
  },
  getQuantity() {
    return prefixOrder + 'applet/update/quantity'
  },
  addCard() {
    return prefixOrder + 'applet/addCart'
  },
  preOrder() {
    return prefixOrder + 'applet/preOrder'
  },
  preTrialOrder() {
    return prefixOrder + 'applet/preTrialOrder'
  },
  orderDetail() {
    return prefixOrder + 'applet/orderDetail'
  },
  getList() {
    return prefixOrder + 'applet/orderListByMemberId'
  },
  bookOrder() {
    return prefixOrder + 'applet/bookOrder'
  },
  bookTrialOrder() {
    return prefixOrder + 'applet/bookTrialOrder'
  },
  linkToBuy() {
    return prefixOrder + 'applet/linkToBuy'
  },
  prepay() {
    return prefixOrder + 'applet/pay/prepay'
  },
  //更新状态
  updateStatus() {
    return prefixOrder + 'applet/closeOrder'
  },
  getDiffStatusCount() {
    return prefixOrder + 'applet/getDiffStatusCount'
  },
  getsubmitFormId() {
    return prefixOrder + 'applet/submitFormId'
  },
  //验证码礼 
  codeToGift() {
    return prefixOrder + 'applet/codeToGift'
  },
  //保存定制服务
  insCustService() {
    return prefixOrder + 'applet/insCustService'
  },
  //更新定制服务
  updCustService() {
    return prefixOrder + 'applet/updCustService'
  },
  //定制服务详情
  detailCustService() {
    return prefixOrder + 'applet/detailCustService'
  },
  // 小美盒专用
  selSmallBeautyBox() {
    return prefixOrder + 'applet/small/selSmallBeautyBox'
  },
  selSmallGoods() {
    return prefixOrder + 'applet/small/selSmallGoods'
  },
  selGiftBox() {
    return prefixOrder + 'applet/small/selGiftBox'
  },
  // 加入定制购物车
  insSmallBeautyCart() {
    return prefixOrder + 'applet/small/insSmallBeautyCart'
  },
  // 好友订单
  friendOrder() {
    return prefixOrder + 'applet/friendOrder'
  },
  // 好友下单
  friendbookOrder() {
    return prefixOrder + 'applet/friendbookOrder'
  },
  // 好友收礼
  orderGoodslist() {
    return prefixOrder + 'applet/orderGoodslist'
  },
  // 收礼地址
  updateaddress() {
    return prefixOrder + 'api/order/updateaddress'
  },
  // 定制送礼查id
  selGoodsId() {
    return prefixOrder + 'applet/small/selGoodsId'
  },
  // 获取订阅消息
  gettemplate() {
    return prefixOrder + 'applet/msgInfo'
  },
  // 订阅成功回传消息
  subscribe() {
    return prefixOrder + 'applet/subscribe'
  },
  //判断是否已经购买付邮试用
  judgeOrder() {
    return prefixOrder + 'applet/judgeOrder'
  },
  //物流
  selLogistics() {
    return prefixOrder + 'applet/selLogistics'

  },
  //付邮试用
  selectMemberQualifications() {
    return prefixOrder + 'applet/selectMemberQualifications'
  }
}
let members = {
  // 获取会员接口
  loginByWeixin() {
    return prefixMember + 'applet/loginByWeixin'
  },
  //获取微信手机号
  memberPhone() {
    return prefixMember + 'applet/memberPhone'
  },
  bindPhone() {
    return prefixMember + 'applet/bindPhone'
  },
  codes() {
    return prefixMember + 'applet/sms/codes'
  },
  getDiy() {
    return prefixMember + 'applet/sms/codes'
  },
  getminiprogram() {
    return prefixMember + 'api/member/miniprogram'
  }
}
let markings = {
  //订单详情送礼status
  friendGiftStatus() {
    return prefixMarking + 'applet/friendGift/status'
  },
  //确认订单获取优惠券
  existsCouponListByMemberCart() {
    return prefixMarking + 'applet/existsCouponListByMemberCart'
  },


  // 获取优惠券
  selectUserCoupon() {
    return prefixMarking + 'applet/selectUserCoupon'
  },
  //查询活动
  selActivaty() {
    return prefixMarking + 'selActivaty'
  },
  //抽奖
  selActivatyApplet() {
    return prefixMarking + 'selActivatyApplet'
  },
  //抽奖记录
  selMemberPrize() {
    return prefixMarking + 'selMemberPrize'
  },
  getCardList() {
    return prefixMarking + 'api/friendgift/list'
  },
  // 查询分享活动
  selShareList() {
    return prefixMarking + 'applet/selShareList'
  },
  sendTemplate() {
    return prefixMarking + 'applet/sendTemplate'
  },
  // 分享即得
  shareAndGive() {
    return prefixMarking + 'applet/shareAndGive'
  },
  //分享助力页面
  selShareDetail() {
    return prefixMarking + 'applet/selShareDetail'
  },
  //好友助力
  helperSetUp() {
    return prefixMarking + 'applet/helperSetUp'
  },
  startAssis() {
    return prefixMarking + 'applet/startAssis'
  },
  //确定奖品已发放
  confirm() {
    return prefixMarking + 'applet/confirm'
  },

}
let Acks = {
  // 查询商品点赞数
  likeNumber() {
    return prefixAck + 'api/fabulous/selFabulousNum'
  },
  //商品点赞/取赞
  goodsFabulous() {
    return prefixAck + 'api/fabulous/goodsFabulous'
  },
  //短信接口
  sendTemplate() {
    return prefixAck + 'applet/sms/sendTemplate'
  },
  //向谷歌发送请求   
  //事件
  scend() {
    return prefixAck + 'applet/sms/scend'
  },
  //页面
  scends() {
    return prefixAck + 'applet/sms/scends'
  },
  //支付
  scendtrend() {
    return prefixAck + 'applet/sms/scendtrend'
  },
  //获取验证码
  sendTemplate() {
    return prefixAck + 'applet/sms/sendTemplate'
  },
  //获取图片名称
  selImageName() {
    return prefixAck + 'applet/selImageName'
  },
}
let Limit = {
  //获取限时礼包列表
  selectGiftbagList() {
    return prefixLimit+'api/gift/selectGiftbagList'
  },
  //礼盒领取记录
  receiveGiftLog() {
    return prefixLimit+'api/gift/receiveGiftLog'
  },
  //用户礼包使用情况
  selectMemberGiftDetail() {
    return prefixLimit+'api/gift/selectMemberGiftDetail'
  },
   //记录用户聚到来源
   updateChannelByMemberId() {
    return prefixMember+'applet/updateChannelByMemberId'
  },
}


module.exports = {
  goods,
  orders,
  members,
  markings,
  Acks,
  Limit
}